﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace webapp4U.UI.Controls
{
    public partial class ContactSetting : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                webapp4U.BOL.ContactSetting contact = webapp4U.BOL.ContactSetting.GetContactSettingByID(1);
                txtAdminEmail.Text = contact.AdminEmail;
                txtCompany.Text = contact.CompanyName;
                txtEmail.Text = contact.Email;
                txtFax.Text = contact.Fax;
                txtPhone.Text = contact.Phone;
                txtHotline.Text = contact.Hotline;
                txtAddress.Text = contact.Address;
            }
        }



        protected void btSave_Click(object sender, EventArgs e)
        {
            webapp4U.BOL.ContactSetting obj = new webapp4U.BOL.ContactSetting();
            obj.ContactSettingID = 1;
            obj.AdminEmail = txtAdminEmail.Text;
            obj.CompanyName = txtCompany.Text;
            obj.Email = txtEmail.Text;
            obj.Fax = txtFax.Text;
            obj.Phone = txtPhone.Text;
            obj.Hotline = txtHotline.Text;
            obj.Address = txtAddress.Text;
            webapp4U.BOL.ContactSetting.Update(obj);
            lblMsg.Text = ResourceManager.GetString("ModifiedSuccessfully");
            PanelMsg.Visible = true;
        }
}
}